<?php
/**
 * OperationLogRepo.php
 *
 * @copyright   2023 thingsworld.com.cn - All Rights Reserved
 * @link        http://thingsworld.com.cn/
 * @author      stiffer.chen <chenl@thingsworld.com.cn>
 * @created     2023-02-16 03:25:39
 * @modified    2023-02-16 03:25:39
 *
 */

namespace App\Repositories;


use App\Models\OperationLog;

class OperationLogRepo
{
    const BUSINESS_TYPE_EVENT = 'event';
    const BUSINESS_TYPE_WO = 'wo';

    public static function createLog(string $type, int $id, string $body)
    {
        $data = [
            'business_type' => $type,
            'business_id' => $id,
            'business_body' => $body
        ];
        $log = new OperationLog();
        $log->fill($data);
        $log->saveOrFail();
    }
}